$(document).ready(function() {
	var waitToListVue = new Vue({
		el : '#showWaitToDiv',
		data : {
			items : null
		},
		methods : {
			show : function(purchaseOrder) {
				openShowPurchaseOrderBox(purchaseOrder);
			}
		}
	});

		//获得待入库的商品list
	getReceiveMaterialList();

	// 确认入库提交入库
	$("#inStockButton").on("click", function() {
		layer.confirm('确定商品入库？', {
			  btn: ['确定','取消'] //按钮
			}, function(){
				submitMaterial();
			}, function(){
				
			});
	});
	
	
	

	function submitMaterial() {
		baseUtil.httpSend("stock/inStockAjax", null, showResult);
	}

	function showResult(data) {
		if (data == 0) {
			layer.msg('操作失败!');
		} else {
			layer.msg('操作成功!');
			getReceiveMaterialList();
		}

	}

	function getReceiveMaterialList() {
		var data = {
			"state" : 0
		};
		baseUtil.httpSend("stock/getWaitToinStockAjax", data, showData);
	}

	function showData(data) {
		waitToListVue.items = data;
	}

});